package com.car.dal.dao.duty;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgDuty;
import com.car.util.Page;

public class TgDutyDaoImpl extends IbatisCommonDao<TgDuty, Long> implements TgDutyDao {

    public GridObj GetList(TgDuty duty, PageObj pageObj) {
        OrderObj order = new OrderObj();
        order.setDir("desc");
        order.setSort("id");
        // TODO Auto-generated method stub
        return super.findByPage(duty, pageObj, order);
    }

    public Integer getDutyCountByType(TgDuty duty) {
        return this.queryForInteger("getDutyCountByType", duty);
    }

    public List<TgDuty> getDutyByType(TgDuty duty, Page page) {
        duty.setFirstrownum(page.getFirstrownum());
        duty.setPagesize(page.getPagesize());
        List<TgDuty> list = this.queryForEntityList(TgDuty.class, "getDutyByType", duty);
        return list;
    }

	@Override
	public List<TgDuty> getDutyBy(TgDuty duty) {
		List<TgDuty> list = this.queryForEntityList(TgDuty.class, "getDutyBy", duty);
		return list;
	}
}
